#include "board.h"
#include "gd32f3x0.h"
#include "systick.h"
#include "board.h"
/*!
    \brief      main function
    \param[in]  none
    \param[out] none
    \retval     none
*/
#include <stdio.h>
int main(void)
{
    //    BOARD_Clock_Init();
    BOARD_clock_108m_irc8m();
    BOARD_GPIO_Init();
    BOARD_Peripherals_Init();
    systick_config();
    // TODO 下次焊接的时候验证TIM1 输出波形，以及电流采样电流有效性
    while (1) {
        delay_1ms(1000);
        //        gpio_bit_toggle(LED0_GPIO, LED0_PIN);
        //        delay_1ms(1000);
        //        gpio_bit_toggle(LED1_GPIO, LED1_PIN);

        SEND("usart transmit test example!");
    }
}

/* retarget the C library printf function to the USART */
int fputc(int ch, FILE *f)
{
    usart_data_transmit(USART0, (uint8_t) ch);
    while(RESET == usart_flag_get(USART0, USART_FLAG_TBE));
    return ch;
}